/*
 *  rgs_screen.h
 *  RGS
 *
 *  Copyright 2008 Ivan Safrin.
 *
 *  This code is distributed under the LGPL license.
 *  You should have a copy of LGPL.txt distributed
 *  with the project, but if not you can get a copy
 *  at http://www.gnu.org/licenses/
 *
 */
 
#ifndef RGS_SCREEN_H_
#define RGS_SCREEN_H_

#include "rgs_data.h"

#ifdef __cplusplus
extern "C" {
#endif

/* @package Graphics */
/* @beginmodule Screens */

extern RGS_Core *g_rgs;

/** @desc Creates a new screen 
 * @return Pointer to the created screen
*/
extern DECLSPEC RGS_Screen *RGS_CreateScreen();
/** @desc Adds screen to automatic render queue. This is called automatically by RGS_CreateScreen
 *  @param screen Screen to add.
 */
extern DECLSPEC void RGS_AddScreen(RGS_Screen *screen);
/** @desc Adds a child object to the screen's render queue
 *  @param Object to add
 */
extern DECLSPEC void RGS_AddScreenObject(RGS_Screen *screen, RGS_Object *object);
/** @desc Focuses input on a screen.
 *  @param screen Screen to focus input on
 */
extern DECLSPEC void RGS_FocusScreen(RGS_Screen *screen);
/** @desc Focuses the next object in the screen. Useful for tabbing.
 *  @param screen Target screen
 */
extern DECLSPEC void RGS_ScreenFocusNext(RGS_Screen *screen);
/** @desc Focuses a specific object in the target screen
 *  @param screen Target screen
 *  @param object Object to focus 
 */
extern DECLSPEC void RGS_ScreenFocusObject(RGS_Screen *screen, RGS_Object *object);
/** @desc Removes but not destroys a child object of a screen
 *  @param screen Target screen
 *  @param object Object to remove
 */
extern DECLSPEC int  RGS_ScreenRemoveObject(RGS_Screen *screen, RGS_Object *object);
/** @desc Destroys all the objects in the screen. The Destroy function in the object is called automatically.
 *  @param screen Target screen
 */
extern DECLSPEC void RGS_ScreenDestroyObjects(RGS_Screen *screen);
/** @endmodule */

extern DECLSPEC void RGS_ScreenKeyDownEvent(RGS_Screen *screen, int eventCode);
extern DECLSPEC void RGS_ScreenCharInputEvent(RGS_Screen *screen, int charCode);
extern DECLSPEC void RGS_RenderScreen(RGS_Screen *screen);

#ifdef __cplusplus
}
#endif

#endif